<template>
    <view class="content">
        <view class="box">
            <view class="title">试卷</view>
            <view class="u-font-24 u-p-t-10">楼盘名称：{{data.name}}</view>
            <view class="u-font-24 u-p-t-10">试题时间：{{data.start_time}}至{{data.end_time}}</view>
        </view>
        <view class="box">
            <view class="title">考题试题</view>
            <view class="ques" v-for="(item,index) in data.question" :key="index">
                <view class="ques-tit">{{index + 1}}、{{item.question}}</view>
                <view class="option" :class="{active : el.status == 1}" v-for="(el, ind) in item.options" :key="ind">
                    {{el.letter}}. {{el.options}}
                </view>
                <view class="score">分值：{{item.score}}分</view>
            </view>
        </view>
        <view class="btns" v-if="data.status == 1">
            <view class="tg-btn" @click="doExamine(2)">审核通过</view>
            <view class="bh-btn" @click="doExamine(3)">审核驳回</view>
        </view>
    </view>
</template>

<script>
	export default {
		data() {
			return {
                noClick:true,//连点
				id: '',
				data: {},
			}
		},
		onLoad(option) {
			this.id = option.id;
			this.getData()
		},
		methods: {
            // 审核
            doExamine(num) {
                this.$ajax('question_activity_examine', {
                    user_token: this.$getSync('userToken'),
                	id: this.id,//试卷id
                    status: num,//2通过 3驳回
                }).then(ret => {
                	if (ret.success == 1000) {
                		this.$toast('提交成功');
                        setTimeout(() => {
                            this.$backT()
                        },500)
                	} else {
                		this.$toast(ret.msg);
                	}
                });
            },
            
			// 获取详情
			getData() {
				this.$ajax('question_activity_detail', {
                    user_token: this.$getSync('userToken'),
					id: this.id,//试卷id
				}).then(ret => {
					if (ret.success == 1000) {
						this.data = ret.detail
					} else {
						this.$toast(ret.msg);
					}
				});
			},
		}
	}
</script>

<style lang="scss">
    page{
        background-color: #f5f5f5;
    }
    .content{
        padding: 20rpx;
    }
    .box{
        padding: 25rpx;
        border-radius: 20rpx;
        margin-bottom: 20rpx;
        background-color: #fff;
    }
    .title{
        color: #00a1e9;
        font-weight: bold;
    }
    .ques{
        padding: 20rpx 0;
        border-bottom: 2rpx solid #e6e6e6;
    }
    .ques:last-child{
        border-bottom: none;
        padding-bottom: 0;
    }
    .ques-tit{
        font-weight: bold;
        padding-bottom: 20rpx;
    }
    .option{
        color: #808080;
        padding-bottom: 5rpx;
    }
    .active{
        color: #218953;
        font-weight: bold;
    }
    .score{
        color: #f37169;
        padding-top: 15rpx;
    }
    .btns{
        padding: 30rpx 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .btns>view{
        width: calc(680rpx / 2);
        color: #fff;
        font-size: 36rpx;
        text-align: center;
        padding: 25rpx 0;
        border-radius: 50rpx;
    }
    .tg-btn{
        background-color: #00a1e9;
    }
    .bh-btn{
        background-color: #f37169;
    }
    
    
</style>
